def isPrime(num):
    if num == 1 or num == 2 or num == 3 or num == 5:
        return True
    else:
        if num % 2 == 0 or num % 3 == 0 or num % 5 == 0:
            return False
        for i in range(2, num):
            if num % i == 0:
                return False
        return True


temp = 0

for i in range(1, 200001):
    if isPrime(i):
        if temp == 4:
            print(i)
            temp += 1
            temp %= 5
        else:
            print(i, end=" ")
            temp += 1
